<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>堆叠层级z-index</title>
    <style>
        .div1 {
            width: 100px;
            height: 100px;
            background-color: #ff7a7a;

            position: absolute;
            /* 取值是整数，默认是0，取值越大显示顺序越靠上 */
            z-index: 1;
        }

        .div2 {
            width: 100px;
            height: 100px;
            background-color: #41d2ff;

            position: absolute;
            top: 50px;
            left: 50px;
            /* 取值是整数，默认是0，取值越大显示顺序越靠上 */
            z-index: 2;
        }

        .div3 {
            width: 200px;
            height: 200px;
            background-color: red;
        }
    </style>
</head>
<body>
<div class="div1"></div>
<div class="div2"></div>
<div class="div3"></div>
</body>
</html>
